/**
 * @Description VeFormBuilder components
 * @Date 2021/1/20 9:36
 * @Created by HePing
 */
import VeFormBuilder from './builder/formBuilder'
import VeForm from './form/form'
import VeComponent from './form/component'
import VeButtonGroup from './form/buttonGroup'
import VeCascader from './form/cascader'
import VeCheckbox from './form/checkbox'
import VeDatePicker from './form/datePicker'
import VeInput from './form/input'
import VeRadio from './form/radio'
import VeStepper from './form/stepper'
import VeSelect from './form/select'
import VeSwitcher from './form/switcher'
import VeSlider from './form/slider'
import VeDivider from './form/divider'
import VeDict from './form/veDict/index'
import VeJson from './form/VeJson'
import VeHtml from './form/VeHtml'
import VeQuillEditor from './form/VeQuillEditor'
import VePanel from './form/VePanel'
import VeTitle from './form/VeTitle'
import VeCustom from './form/VeCustom'
import VeTable from './form/VeTable'
import VeButtonOption from './other/VeButtonOption'

export const components = {
  VeComponent,
  VeFormBuilder,
  VeForm,
  VeButtonGroup,
  VeCascader,
  VeCheckbox,
  VeDatePicker,
  VeInput,
  VeRadio,
  VeStepper,
  VeSelect,
  VeSwitcher,
  VeSlider,
  VeDivider,
  VeDict,
  VeJson,
  VeHtml,
  VeQuillEditor,
  VePanel,
  VeTitle,
  VeCustom,
  VeTable,
  VeButtonOption
}

const install = function (Vue) {
  Object.keys(components).forEach(k => {
    const o = components[k]
    if (!o) return
    if (!o.name) o.name = k
    Vue.component(o.name, o)
  })
}

export default {
  install,
  ...components
}
